package com.itheima.web.controller;

import com.itheima.vo.AnalysisSummaryVo;
import com.itheima.vo.DataStatisticsVo;
import com.itheima.web.manager.AnalysisManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author Guanxing
 * @date 2021/10/7
 */
@RestController
public class AnalysisController {

    @Autowired
    private AnalysisManager analysisManager;

    //概要统计
    @GetMapping("/dashboard/summary")
    public AnalysisSummaryVo summary() {
        return analysisManager.summary();
    }

    //新增、活跃用户、次日留存率
    @GetMapping("/dashboard/users")
    public DataStatisticsVo dashboard(Long sd, Long ed, String type) {
        return analysisManager.dashboard(sd, ed, type);
    }
}
